/*--------------------------------+
| ArcEngine-Main.cpp			  |
|								  |
| BrokenGlass				      |
|								  |
| Last Change:       			  |
+--------------------------------*/

#include "Main.h"

SDL_Surface *screen;
Uint8		*keystates;

CSprite background;
CSprite sPlayer[2];
CPlayer player;

int main(int argc, char *argv[])
{
	SDL_Event    event;
	bool		 done;
	int FPS = 0, pastFPS = 0, past = 0;

	init_sdl(640, 480, false);
	keystates = SDL_GetKeyState(0);
	printf("<<>> ArcEngine <<>>\n\n");

	background.init("./gfx/bg.png");
	sPlayer[0].init("./gfx/mario.png", 255, 0, 255);
	sPlayer[1].init("./gfx/mario_left.png", 255, 0, 255);

	done = false;

	printf("\n>> Entering Game Loop...\n");
	while (!done)
	{
		while(SDL_PollEvent(&event))
		{
			switch(event.type)
			{
				case SDL_QUIT:
					done = true;
				break;

				default:
				break;
			}
		}
		if (keystates[SDLK_ESCAPE])
			done = true;
	
		background.draw(0,0);
		player.getInput();
		player.move();
		player.draw();		

		SDL_Flip(screen);
	}  
	return 0;
}


